<?php

class CookieManager {

    private $Cookies;
    private $CookieSize;

    public function __construct() {
        $this->Cookies = array();
        $this->CookieHashes = array();
        // Let's put some cookies in our arrays!
        foreach ($_COOKIE as $Name => $Value) {
            $this->Cookies[] = new Cookie($Name, $Value);
        }
        $this->CookieSize = sizeof($this->Cookies);
    }

    public function Get($Name) {
        for ($i = 0; $i < $CookieCount; $i++) {
            if ($Name == $this->Cookies[$i]->GetName()) {
                return $this->Cookies[$i];
            }
        }
        return null;
    }

    public function Add($Cookie) {
        $this->Cookies[] = $Cookie;
        $this->CookieSize++;
    }

    public function Remove($Name) {
        for ($i = 0; $i < $CookieCount; $i++) {
            if ($Name == $this->Cookies[$i]->GetName()) {
                unset($this->Cookies[$i]);
                $this->CookieSize--;
            }
        }
    }

}

?>
